package com.wtzz.police.base.entity;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty.AccessMode;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@Setter
@Getter
public abstract class AbstractAuditingEntity extends AbstractTimeEntity implements Serializable {

    @ApiModelProperty(value = "创建人id", accessMode = AccessMode.READ_ONLY, readOnly = true)
    @CreatedBy
    private String createdBy;

    @ApiModelProperty(value = "修改人id", accessMode = AccessMode.READ_ONLY, dataType = "String", readOnly = true)
    @LastModifiedBy
    private String modifiedBy;
}